
package com.mp.chart.markerview;

import android.content.Context;
import android.widget.TextView;

import com.mp.chart.components.MarkerView;
import com.mp.chart.data.CandleEntry;
import com.mp.chart.data.Entry;
import com.mp.chart.utils.StringUtils;
import com.android.R;

public class HighValueMarkerView extends MarkerView {

    private TextView tvContent;

    public HighValueMarkerView(Context context, int layoutResource) {
        super(context, layoutResource);

        tvContent = (TextView) findViewById(R.id.tvContent);
        tvContent.setBackgroundColor(0xcc272c3f);
    }

    @Override
    public void refreshContent(Entry e, int dataSetIndex) {

        CandleEntry data = (CandleEntry) e;

        tvContent.setText(StringUtils.doubleToDoubleString(data.getHigh())+"");
    }

    @Override
    public int getXOffset() {
        return 0;
    }

    @Override
    public int getYOffset() {
        return -getHeight() / 2;
    }
}
